﻿USE [sms]
GO
if exists(select name from sysobjects where name ='cp_login' and type = 'P')
drop procedure cp_login
go 
/****** Object:  StoredProcedure [dbo].[cp_login]    Script Date: 11/26/2010 14:44:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create procedure [dbo].[cp_login]
@CIL nvarchar(50),--输入参数，发件人
@reutrnUserID int output --输出参数，返回一个用户ID或者错误信息
as
declare @UserID int
	--传入的名字.返回0为false
	if(len(@CIL) != 0)
		begin
			select @UserID = UserID from [User] where CIL= @CIL and IsActive = 1
		end
	if(len(@UserID) != 0)
		begin
			select @reutrnUserID = @UserID
		end
	else 
		begin
			select @reutrnUserID = 0
		end
GO
